package com.jjh.util;

import com.jjh.pojo.User;

/**
 * 用户当前线程类，可以把用户
 */
public class UserThreadLocal extends ThreadLocal<User>  {

   // private  User user;

    public UserThreadLocal() {
    }

    /**
     * 获取当前用户信息
     * @return
     */
    @Override
    public User get() {
        return super.get();
    }

    /**
     * 存放当前用户信息
     * @param user the value to be stored in the current thread's copy of
     *        this thread-local.
     */
    @Override
    public void set(User user) {
        super.set(user);
    }

    /**
     * 删除当前用户信息
     */
    @Override
    public void remove() {
        super.remove();
    }
}
